package cn.px.service.purchase;

import cn.px.common.bean.AbstractPageResultBean;
import cn.px.dao.dto.purchase.PurchaseListDTO;
import cn.px.dao.dto.purchase.PurchaseOrderDTO;
import cn.px.dao.entity.purchase.PurchaseApply;
import cn.px.dao.entity.purchase.PurchaseContractMainList;
import cn.px.dao.entity.purchase.PurchaseList;
import cn.px.dao.entity.purchase.PurchaseOrder;
import cn.px.dao.vo.query.purchase.PurchaseListVO;
import cn.px.service.base.IBaseService;
import org.springframework.web.multipart.MultipartFile;

import java.math.BigDecimal;
import java.util.List;

/**
 * @Description 采购明细 service
 * @author 品讯科技
 * @date 2024-08
 * @Version Copyright (c) 2020,北京乾元坤和科技有限公司 All rights reserved.
 */
public interface PurchaseListService extends IBaseService<PurchaseList, PurchaseListDTO> {

    /**
     * 批量删除
     *
     * @param ids ：
     * @return ：
     */
    int batchDelete(List<String> ids);

    /**
     * 分页查询
     *
     * @param record
     * @param pageNum
     * @param pageSize
     * @return
     */
    AbstractPageResultBean<PurchaseListVO> selectPageList(PurchaseListDTO record, int pageNum, int pageSize);

    /**
     * 批量更新
     *
     * @param record
     */
    void batchUpdateChoose(PurchaseListDTO record);

    /**
     * 添加
     *
     * @param order
     * @param objects
     */
    void handleListByOrder(PurchaseOrder order, List<Object> objects, Integer action);

    /**
     * 获取供应商以及金额
     *
     * @param orderId
     */
    List<PurchaseList> getSupplierAndMoneyByOrder(String orderId);


    /**
     * 添加
     *
     * @param order
     */
    void handleListByApplyForOrder(PurchaseOrder order);

    /**
     * 询价
     *
     * @param record
     */
    void handleListByEnquiry(PurchaseOrderDTO record);


    /**
     * 添加
     *
     * @param apply
     * @param objects
     */
    void handleListByApply(PurchaseApply apply, List<Object> objects, Integer action);

    /**
     * 添加
     *
     * @param mainList
     * @param objects
     */
    void handleListByContractMainList(PurchaseContractMainList mainList, List<Object> objects, Integer action);

    /**
     * 更新 已到数量
     *
     * @param list
     */
    void updateArrivedQuantity(PurchaseOrder order, List<PurchaseList> list);

    /**
     * 分页查询
     *
     * @param record
     * @return
     */
    List<PurchaseListVO> selectListHaveStoreNum(PurchaseListDTO record);

    void deleteByApply(String applyId);

    /**
     * 导入明细
     *
     * @param file            明细文件
     * @param purchaseOrderId 采购单ID
     */
    void importListForEnquiry(MultipartFile file, String purchaseOrderId, Integer moneyType, BigDecimal exchangeRate);


}
